import request from '@/utils/request';

// 获取考试列表
export function queryPageList(params) {
	return request({
		method: 'get',
		url: 'testExam/query',
		params
	});
}

// 新增考试
export function addExam(data) {
	return request({
		method: 'post',
		url: 'testExam/add',
		data
	});
}

// 修改考试
export function updateExam(data) {
	return request({
		method: 'post',
		url: 'testExam/update',
		data
	});
}

// 删除考试
export function deleteExam(id) {
	return request({
		method: 'get',
		url: 'testExam/delete/' + id
	});
}

// 获取考试详情
export function examDetail(id) {
	return request({
		method: 'get',
		url: 'testExam/query/' + id
	});
}

//查询我的考试列表
export function queryMyExamList(params) {
	return request({
		method: 'get',
		url: 'testExam/queryMyExam',
		params
	});
}

//生成试卷
export function genExamPaper(id) {
	return request({
		method: 'get',
		url: 'testExam/generatePaper/' + id
	});
}

//提交考试
export function submitExamPaper(data) {
	return request({
		method: 'post',
		url: 'testExam/submitPaper',
		data
	});
}